Repository navigation
Add optional Monaco code editor autoformat - #13
Open
cherepanov wants to merge 9 commits into
Open
cherepanov wants to merge 9 commits into
cherepanov wants to merge 9 commits into
Conversation
…onal-monaco-code-editor-autoformat
…onal-monaco-code-editor-autoformat
cherepanov
marked this pull request as ready for review
November 26, 2026 12:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
autoformatfor Designer Monaco code editors (format on open / value flush, format on paste/type).JsonCodeEditor, Edit JSON /JsonView).Packages affected
@react-form-builder/designertests/componentChecklist
npm run check-alllocally (or explain why not)tests/when appropriatedocumentation/docsfor user-facing changesBreaking changes / migration
None.
Manual testing
Use the demo/designer with a form that has JSON editors (Edit JSON and property JSON). Compare compact vs formatted buffers.
1. Edit JSON — paste minified form (shows the difference)
data-testidlogin/password).Minified (paste this):
{"version":"1","form":{"key":"Screen","type":"Screen","props":{},"children":[{"key":"login","type":"RsInput","props":{"label":{"value":"Login"}},"schema":{"validations":[{"key":"min","args":{"limit":3}},{"key":"includes","args":{"value":"2","message":"Should include 2"}}]},"htmlAttributes":[{"name":"data-testid","value":"login"}]},{"key":"password","type":"RsInput","props":{"label":{"value":"Password"},"type":{"value":"password"}},"schema":{"validations":[{"key":"max","args":{"limit":12}}]},"htmlAttributes":[{"name":"data-testid","value":"password"}]}]},"localization":{},"languages":[{"code":"en","dialect":"US","name":"English","description":"American English","bidi":"ltr"}],"defaultLanguage":"en-US"}Expected pretty result (shape to match):
{ "version": "1", "form": { "key": "Screen", "type": "Screen", "props": {}, "children": [ { "key": "login", "type": "RsInput", "props": { "label": { "value": "Login" } }, "schema": { "validations": [ { "key": "min", "args": { "limit": 3 } }, { "key": "includes", "args": { "value": "2", "message": "Should include 2" } } ] }, "htmlAttributes": [ { "name": "data-testid", "value": "login" } ] }, { "key": "password", "type": "RsInput", "props": { "label": { "value": "Password" }, "type": { "value": "password" } }, "schema": { "validations": [ { "key": "max", "args": { "limit": 12 } } ] }, "htmlAttributes": [ { "name": "data-testid", "value": "password" } ] } ] }, "localization": {}, "languages": [ { "code": "en", "dialect": "US", "name": "English", "description": "American English", "bidi": "ltr" } ], "defaultLanguage": "en-US" }Fixture source:
tests/component/tests/forms/login-form.json.2. Edit JSON — open existing form
tests/component/tests/forms/designer-form.json(or any saved form).formatOnPaste/formatOnTypestay active while editing.3. Property JSON editor
{"toolbar":["bold","italic"]}.4. Regression